﻿namespace Sidvall.FileSystemManager.Net.Services.V1
{
	public sealed partial class CleanConfig
	{
		#region Deserialize

		public static CleanConfig Deserialize(string value)
		{
			Sidvall.FileSystemManager.Net.Services.V1.CleanConfig dataItem;

			try
			{
				if (!string.IsNullOrWhiteSpace(value))
					dataItem = Sidvall.Serialization.SerializerManager.Current.Deserialize<Sidvall.FileSystemManager.Net.Services.V1.CleanConfig>(value);
				else
					dataItem = null;
			}
			catch
			{
				dataItem = null;
			}
			if (dataItem == null)
			{
				dataItem = new Sidvall.FileSystemManager.Net.Services.V1.CleanConfig()
				{
					CleanConfigId = 1,
					FolderPath = "** PATH TO ROOT FOLDER **",
					CleanBackupFolders = true,
					CleanBuildFolders = true,
					CleanPackageFolder = true,
					RemoveSourceControlLinks = true,
				};
			}
			return dataItem;
		}

		#endregion
	}
}